#!/bin/bash

# define colors in echo output
black='\033[0;30m'
red='\033[0;31m'
green='\033[0;32m'
brown='\033[0;33m'
blue='\033[0;34m'
pruple='\033[0;35m'
endColor='\033[0m'


echo ""
echo ""
echo -e "Trying to modify your sshd_config file..."
echo -e "Please follow the instructions on screen..."
echo ""
echo ""

if [ ! -f /etc/ssh/sshd_config ]; then
echo 'Installing sshd .....'
sudo apt-get update -qq && sudo apt-get install -y openssh-server
fi


sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

sudo systemctl restart ssh

echo ""
echo ""
echo -e "Set new password for root..."
echo ""
echo ""
#sudo passwd

sudo sh -c 'echo root:123456 | chpasswd'
echo ""
echo ""
echo -e "I have set your root password to: ${red} 123456 ${endColor}"
echo ""
echo ""
echo -e "Done."




